﻿using DLog.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DLog
{
    public interface ILogger
    {
        /// <summary>
        /// Initialize log
        /// </summary>
        /// <param name="target"></param>
        /// <param name="addition"></param>
        void Init(string target, string addition);
        /// <summary>
        /// The most common form of recorded information, generally used for ordinary output
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Trace(string message);
        /// <summary>
        /// The most common form of recorded information, generally used for ordinary output
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Trace(Exception ex);
        /// <summary>
        /// The most common form of recorded information, generally used for ordinary output
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Trace(string message, Exception ex);
        /// <summary>
        /// The same recording information, but appears less frequently than trace, generally used to debug the program
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Debug(string message);
        /// <summary>
        /// The same recording information, but appears less frequently than trace, generally used to debug the program
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Debug( Exception ex);
        /// <summary>
        /// The same recording information, but appears less frequently than trace, generally used to debug the program
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Debug(string message, Exception ex);
        /// <summary>
        /// information type information
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Info(string message);
        /// <summary>
        /// information type information
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Info(Exception ex);
        /// <summary>
        /// information type information
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Info(string message, Exception ex);
        /// <summary>
        /// Warning messages generally used for more important occasions
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Warn(string message);
        /// <summary>
        /// Warning messages generally used for more important occasions
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Warn(Exception ex);
        /// <summary>
        /// Warning messages generally used for more important occasions
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Warn(string message, Exception ex); 
        /// <summary>
        /// error message
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Error(string message);
        /// <summary>
        /// error message
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Error(Exception ex);
        /// <summary>
        /// error message
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Error(string message, Exception ex);
        /// <summary>
        /// Fatal exception information. In general, the program will not be able to continue execution after the fatal exception.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Fatal(string message);
        /// <summary>
        /// Fatal exception information. In general, the program will not be able to continue execution after the fatal exception.
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Fatal( Exception ex);
        /// <summary>
        /// Fatal exception information. In general, the program will not be able to continue execution after the fatal exception.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Fatal(string message, Exception ex);
        /// <summary>
        /// Through the loglevel to record log information
        /// </summary>
        /// <param name="meesage"></param>
        /// <param name="logLevel"></param>
        /// <returns></returns>
        bool Log(string meesage, int logLevel);
       /// <summary>
        /// Through the loglevel to record log information
       /// </summary>
       /// <param name="ex"></param>
       /// <param name="logLevel"></param>
       /// <returns></returns>
        bool Log(Exception ex, int logLevel);
        /// <summary>
        /// Through the loglevel to record log information
        /// </summary>
        /// <param name="meesage"></param>
        /// <param name="ex"></param>
        /// <param name="logLevel"></param>
        /// <returns></returns>
        bool Log(string meesage, Exception ex, int logLevel);
        /// <summary>
        /// record log  message
        /// </summary>
        /// <param name="lm"></param>
        /// <returns></returns>
        bool Log(LogModel lm);
        /// <summary>
        /// Log information available through the journal number
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        LogModel GetLog(string logId);
        /// <summary>
        /// Through the logging level of a page of data
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs();
        /// <summary>
        /// Through the logging level of a page of data
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(int pageIndex, int pageSize, out int totalCount);
        /// <summary>
        /// Through the logging level of a page of data
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(int logLevel, int pageIndex, int pageSize, out int totalCount);
        /// <summary>
        /// By creating a time interval to a page of data
        /// </summary>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(DateTime createStartDate, DateTime createEndDate, int pageIndex, int pageSize, out int totalCount);
        /// <summary>
        /// Through the logging level and creating a time interval get a page of data
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(int logLevel, DateTime createStartDate, DateTime createEndDate, int pageIndex, int pageSize, out int totalCount);
        /// <summary>
        /// Delete log information
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        bool DeleteModel(string logId);
        /// <summary>
        /// Delete logs information
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        bool DeleteList(List<string> logIds);
    }
}
